<HTML>
<HEAD>
<TITLE>JavaScript Source Code 3000:  Misc.:  Mystery Madlib</TITLE>
<META HTTP-EQUIV="JavaScript Source Code 3000" CONTENT = "no-cache">
<META NAME="date" CONTENT="2000-09-09">
<META NAME="channel" CONTENT="Web Developer">
<META NAME="author" CONTENT="JavaScript Source Code 3000">
<META NAME="section" CONTENT="Miscellaneous">
<META NAME="description" CONTENT="Here is another of those wonderful madlibs.  This time, however, you have no idea of what the topic is!  It's always funnier that way!  Check it out!">

<SCRIPT LANGUAGE = "JavaScript">
<!-- Begin 
function create(form) {        
if (confirm("Are you sure?")) {        
storyWin = window.open("","StoryWin","toolbar=no,width=320,height=325,directories=no,status=yes,scrollbars=yes,resize=no,menubar=no");                
with (storyWin.document) {                 
writeln ("<P><b> One day while I was " + form.input1.value + " in the " + form.input2.value + " a " + form.input3.value + " " + form.input4.value + " fell through the roof.  It immediately jumped on the " + form.input5.value + " and knocked over the </b>");                
writeln ("<b>" + form.input6.value + ".  Then it ran out the door into the " + form.input7.value + " and " + form.input8.value + " a " + form.input9.value + " off the " + form.input10.value + ".  </b>");                
writeln ("<b>  It then knocked a glass of " + form.input11.value + " off the coffee table.  After " + form.input12.value + " minutes of chasing the " + form.input4.value + " through the house I finally caught it and put it outside.  It quickly climbed the nearest " + form.input13.value + ".</b>");                
writeln ("<BR>"); // needs a <BR> to display last line, bug in JS                
      }        
   }
}
// End -->
</SCRIPT>
</HEAD>

<BODY BGCOLOR=#ffffff vlink=#0000ff>

<BR>
<center>
<table width="600" cellpadding="0" cellspacing="10">
<tr>
<td width="468" align="center">

	
</td>
<td width="120" align="center">

	
</td>
</tr>
</table>
<BR>
<BR>
<BASEFONT SIZE=3>
  <FONT SIZE=6>
<B><FONT SIZE="+2" FACE="Helvetica,Arial" ALIGN=RIGHT COLOR="#0000FF">
<b><A HREF="../index.htm" /" TARGET="_top">
Home</A> </b><img src="../img/arrow.gif" /img/arrow.gif" height=13 width=7 border=0 alt="}"> <b><A HREF="index.htm" /miscellaneous/"><font color="#FF0000">Miscellaneous</font></A> </b>
<img src="../img/arrow.gif" /img/arrow.gif" height=13 width=7 border=0 alt="}"> <FONT COLOR="#006666">Mystery Madlib</FONT></b></FONT><BR>
</B><BR>
  </FONT>
<TABLE BORDER=0 WIDTH=500 CELLPADDING=3 CELLSPACING=0>
<tr><td><font FACE=" helvetica,arial,geneva">
<br>
<br>
<!-- Description --><!--content_start-->

Here is another of those wonderful madlibs.  This time, however, you have no idea of what the topic is!  It's always funnier that way!  Check it out!<br><hr>
</td></tr>
</table>
<!--  Demonstration -->
<BODY>
<CENTER>
<FORM>
<TABLE BORDER = 1 CELLPADDING = 0>
<TR><TD>
<b>Verb:</b>
<TD><INPUT TYPE="text" NAME="input1" size=45><BR>
</TD></TR><TR><TD>
<b>Room in a House:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input2" size=45 ><BR>
</TD></TR><TR><TD>
<b>Adjective:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input3" size=45 ><BR>
</TD></TR><TR><TD>
<b>Noun:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input4" size=45 ><BR>
</TD></TR><TR><TD>
<b>Piece of Furniture:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input5" size=45 ><BR>
</TD></TR><TR><TD>
<b>Noun:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input6" size=45 ><BR>
</TD></TR><TR><TD>
<b>Room in a House:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input7" size=45 ><BR>
</TD></TR><TR><TD>
<b>Verb:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input8" size=45 ><BR>
</TD></TR><TR><TD>
<b>Noun:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input9" size=45 ><BR>
</TD></TR><TR><TD>
<b>Piece of Furniture:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input10" size=45 ><BR>
</TD></TR><TR><TD>
<b>A Liquid:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input11" size=45 ><BR>
</TD></TR><TR><TD>
<b>Number:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input12" size=45 ><BR>
</TD></TR><TR><TD>
<b>Noun:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input13" size=45 >
</TD>
</TR>
<TR>
<TD>
</TD>
</TR>
</TABLE>
<BR></B>
<INPUT TYPE = "button" VALUE="Create Story" onClick = "create(this.form)">
</FORM>
<P>
<BR>
<P>
<a name="source">
<TABLE BORDER=0 WIDTH=500 CELLPADDING=3 CELLSPACING=0>
<tr><td BGCOLOR=yellow><font FACE="helvetica,arial,geneva"><b>JavaScript Source Code 3000:  Misc.:  Mystery Madlib</b>
<p>Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as NotePad or SimpleText) and save (Control-s or Apple-s).  The script is yours!<br><br></font></td></tr>
<tr><td BGCOLOR=yellow ALIGN=CENTER>
<form NAME="copy">

<DIV align="center">
<input type=button value="Highlight All" onClick="javascript:this.form.txt.focus();this.form.txt.select();">&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE="text" NAME="total" VALUE="Script Size:  3.09 KB  " size="24">
</DIV>

<textarea NAME="txt" ROWS=20 COLS=75 WRAP=VIRTUAL>

&lt;!-- TWO STEPS TO INSTALL MYSTERY MADLIB:

   1.  Paste the coding into the HEAD of your HTML document
   2.  Add the last code into the BODY of your HTML document  --&gt;

&lt;!-- STEP ONE: Copy this code into the HEAD of your HTML document  --&gt;

&lt;HEAD&gt;

&lt;SCRIPT LANGUAGE = "JavaScript"&gt;

&lt;! &gt;
&lt;! &gt;

&lt;!-- Begin 
function create(form) {        
if (confirm("Are you sure?")) {        
storyWin = window.open("","StoryWin","toolbar=no,width=320,height=325,directories=no,status=yes,scrollbars=yes,resize=no,menubar=no");                
with (storyWin.document) {                 
writeln ("&lt;P&gt;&lt;b&gt; One day while I was " + form.input1.value + " in the " + form.input2.value + " a " + form.input3.value + " " + form.input4.value + " fell through the roof.  It immediately jumped on the " + form.input5.value + " and knocked over the &lt;/b&gt;");                
writeln ("&lt;b&gt;" + form.input6.value + ".  Then it ran out the door into the " + form.input7.value + " and " + form.input8.value + " a " + form.input9.value + " off the " + form.input10.value + ".  &lt;/b&gt;");                
writeln ("&lt;b&gt;  It then knocked a glass of " + form.input11.value + " off the coffee table.  After " + form.input12.value + " minutes of chasing the " + form.input4.value + " through the house I finally caught it and put it outside.  It quickly climbed the nearest " + form.input13.value + ".&lt;/b&gt;");                
writeln ("&lt;BR&gt;");   
      }        
   }
}
// End --&gt;
&lt;/SCRIPT&gt;

&lt;!-- STEP TWO: Put this code into the BODY of your HTML document  --&gt;

&lt;BODY&gt;

&lt;CENTER&gt;
&lt;FORM&gt;
&lt;TABLE BORDER = 1 CELLPADDING = 0&gt;
&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Verb:&lt;/b&gt;
&lt;TD&gt;&lt;INPUT TYPE="text" NAME="input1" size=45&gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Room in a House:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input2" size=45 &gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Adjective:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input3" size=45 &gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Noun:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input4" size=45 &gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Piece of Furniture:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input5" size=45 &gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Noun:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input6" size=45 &gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Room in a House:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input7" size=45 &gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Verb:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input8" size=45 &gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Noun:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input9" size=45 &gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Piece of Furniture:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input10" size=45 &gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;A Liquid:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input11" size=45 &gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Number:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input12" size=45 &gt;&lt;BR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;
&lt;b&gt;Noun:&lt;/b&gt;
&lt;/TD&gt;&lt;TD&gt;
&lt;INPUT TYPE="text" NAME="input13" size=45 &gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TABLE&gt;
&lt;BR&gt;&lt;/B&gt;
&lt;INPUT TYPE = "button" VALUE="Create Story" onClick = "create(this.form)"&gt;
&lt;/FORM&gt;
&lt;/CENTER&gt;

 

&lt;!-- Script Size:  3.09 KB  --&gt;
</textarea><br><font FACE="helvetica,arial,geneva"></font></td></tr>

</table>
</form>
</FONT>
</CENTER>


</center>
</body></html>